package ai4games_tests.guides;

import processing.core.PApplet;

import game2dai.World;
import game2dai.utils.StopWatch;



public class SimpleMovement_1 extends PApplet {

	// Global variable declaration area
	World world;
	StopWatch sw;
	
	public void setup(){
		size(480,320);
		world = new World(width, height);
		sw = new StopWatch();
		// Other setup code here
		
		sw.reset(); // should always be last line in setup
	}
	
	public void draw(){
		double elapsedTime = sw.getElapsedTime();
		world.update(elapsedTime);
		background(200,255,200);
		world.draw();
		// We can also find out how long it takes to 
		// update the world this time is the average 
		// of the last 100 updates so may take a moment
		// to appear on the screen.
		fill(0);
		text("Update time "+world.worldUpdateTime, 10,20);
	}
}
